package com.wasp.collector.utils;

import java.math.BigDecimal;
import java.util.UUID;

public class StringUtils {

   public static boolean isNullOrEmpty(String str){
	   return str == null || str.isEmpty();
   }
   public static String generateUUID(){
	   return UUID.randomUUID().toString();
   }

	public static float formatFloat(float f, int num) {
		BigDecimal b = new BigDecimal(f);
		float f1 = b.setScale(num, BigDecimal.ROUND_HALF_UP).floatValue();
		return f1;
	}
	public static float formatFloat(double d, int num) {
		BigDecimal b = new BigDecimal(d);
		float f1 = b.setScale(2, BigDecimal.ROUND_HALF_UP).floatValue();
		return f1;
	}
}
